Skip to content

Conversation

niemyjski
Copy link
Member

Introduces improved nested field support and related tests.

This commit addresses the need for testing nested fields. It includes a new test file, updates configurations, and adds utilities for generating test data with nested properties. A nested field is also added to the default search fields.

Introduces nested field support and related tests.

This commit addresses the need for testing nested fields.
It includes a new test file, updates configurations,
and adds utilities for generating test data with nested properties.
A nested field is also added to the default search fields.
@niemyjski niemyjski self-assigned this Jul 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces improved nested field support for Elasticsearch repositories with comprehensive test coverage. The changes enable testing and functionality for nested field queries, aggregations, and default search configuration.

  • Adds a new comprehensive test file for nested field functionality
  • Updates the Employee model generator to support peer review data
  • Configures default search fields to include nested field properties

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Employee.cs Adds peerReviews parameter to the Generate method for creating test data with nested fields
EmployeeIndex.cs Configures default search fields to include employee ID and nested peer review reviewer ID
NestedFieldTests.cs New comprehensive test file covering nested field queries, aggregations, and serialization scenarios
AggregationQueryTests.cs Removes duplicate nested aggregation test and unused import
Comments suppressed due to low confidence (1)

tests/Foundatio.Repositories.Elasticsearch.Tests/AggregationQueryTests.cs:114

  • This line overwrites the first employee's ID with "employee2", which should likely be setting the second employee's ID instead. This should be employees[1].Id = "employee2";
            Age = 30,

Adds tests to verify filtering of nested aggregations using include and exclude.

This ensures that aggregations can be filtered based on specific values within nested fields, providing more granular control over the aggregation results.

Also improves readability in existing tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant